﻿<chart:SparrowWindow x:Class="Sparrow.Chart.Demos.MainWindow" x:Name="mainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" MinHeight="410" MinWidth="410"
        xmlns:local="clr-namespace:Sparrow.Chart.Demos"  Icon="../Resources/Stocks.ico"  ShowIconOnTitleBar="False"
        xmlns:cpu="clr-namespace:CPUPerformance"  BorderBrush="Black" BorderThickness="1"            
        xmlns:chart="http://sparrowtoolkit.codeplex.com/wpf" WindowStartupLocation="CenterScreen"
        Title="Sparrow Chart Demos Browser" Height="700" Width="950" Foreground="Black" >    
    <Window.Resources>
        <ResourceDictionary>
            <ResourceDictionary.MergedDictionaries>
                <ResourceDictionary Source="../Resources/Styles.xaml" />
            </ResourceDictionary.MergedDictionaries>
        </ResourceDictionary>
    </Window.Resources>
    <chart:SparrowWindow.DataContext>
        <local:DemoViewModel/>
    </chart:SparrowWindow.DataContext>
    <chart:SparrowWindow.WindowCommands>
        <chart:WindowCommands>
            <chart:SparrowButton FontSize="10" Command="{Binding AboutCommand}" CommandParameter="{Binding ElementName=mainWindow}" Content="About"/>
        </chart:WindowCommands>
    </chart:SparrowWindow.WindowCommands>
    <Grid >       
            <Grid.Resources>
            <local:SampleToContentConverter x:Key="sampleToContentConverter"/>
        </Grid.Resources>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="200"/>
            <ColumnDefinition Width="*"/>
        </Grid.ColumnDefinitions>
        <TreeView x:Name="demos" ScrollViewer.VerticalScrollBarVisibility="Auto" VerticalContentAlignment="Center"
                          BorderThickness="0"                         
                          ItemContainerStyle="{StaticResource TreeViewItemStyle}"
                          ItemsSource="{Binding Categories}"
                          ItemTemplate="{StaticResource SampleTemplate}" Margin="5,10" >
           
        </TreeView>
        <GridSplitter Background="#FF707070" BorderBrush="#FF707070" Margin="0,20" BorderThickness="0.5" />
        <Grid Grid.Column="1">
            <ScrollViewer x:Name="contentArea" Content="{Binding ElementName=demos,Path=SelectedItem,Converter={StaticResource sampleToContentConverter}}" VerticalScrollBarVisibility="Auto" HorizontalScrollBarVisibility="Auto" CanContentScroll="True" SnapsToDevicePixels="True">                
            </ScrollViewer>           
        </Grid>
    </Grid>
</chart:SparrowWindow>
